<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class myCalculator {
    constructor(value) {
        this.value = value
    }
    // 加法
    add(newValue) {
        this.value = this.value + newValue
        return this
    }
    // 减法
    reduce(newValue) {
        this.value = this.value - newValue
        return this
    }
    // 其他的类似
}
const obj = new myCalculator(100)
obj.add(1).reduce(10)
console.log(obj.value);
    </script>
</body>
</html>